package controllers

import (
	"github.com/astaxie/beego"
)

type Coding struct {
    beego.Controller
}

type Msg_s struct{
	Code int8
	Msg string
	Date interface{}
}

func (this *Coding) Suc(data interface{}) {
	var msg_p =new(Msg_s); 
	msg_p.Code = 0 
	msg_p.Msg  = "success"
	msg_p.Date = data
	
    this.Data["json"] = msg_p
    this.ServeJSON()
	//fmt.Print(this)
} 

func (this *Coding) Faild(code int8, data interface{}) {
	var msg_p =new(Msg_s); 
	msg_p.Code = code
	msg_p.Msg  = "fail"
	msg_p.Date = data
	
    this.Data["json"] = msg_p
    this.ServeJSON()
	//fmt.Print(this)
} 
